#include <stdio.h>

void hieth_set_regbit(int va, int vb, int vc)
{
 /*80484d0:	55                   	push   %ebp
 80484d1:	89 e5                	mov    %esp,%ebp
 80484d3:	83 ec 28             	sub    $0x28,%esp
 80484d6:	c7 45 f4 ff ff ff ff 	movl   $0xffffffff,-0xc(%ebp) */
	int a = -1;

 /*80484dd:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)	// vb
 80484e1:	0f 95 c0             	setne  %al
 80484e4:	0f b6 c0             	movzbl %al,%eax
 80484e7:	89 45 0c             	mov    %eax,0xc(%ebp)*/
	vb = (vb!=0);

 /*80484ea:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)	
 80484ee:	74 07                	je     80484f7 <hieth_set_regbit+0x27> */
 /*80484f0:	b8 84 87 04 08       	mov    $0x8048784,%eax
 80484f5:	eb 05                	jmp    80484fc <hieth_set_regbit+0x2c>
 80484f7:	b8 89 87 04 08       	mov    $0x8048789,%eax
 80484fc:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048500:	c7 04 24 8f 87 04 08 	movl   $0x804878f,(%esp)
 8048507:	e8 84 fe ff ff       	call   8048390 <printf@plt>*/
	if (vb != 0) {
		printf("%d\n", "True");
	}
	else
		printf("%d\n", "Flase");

 /*804850c:	8b 45 10             	mov    0x10(%ebp),%eax	// vc
 804850f:	ba 01 00 00 00       	mov    $0x1,%edx		// edx=0x1
 8048514:	89 c1                	mov    %eax,%ecx		// ecx=vc
 8048516:	d3 e2                	shl    %cl,%edx			// edx=0x1<<vc
 8048518:	89 d0                	mov    %edx,%eax		// vb=0x<<vc
 804851a:	f7 d0                	not    %eax				*/

 /*804851c:	21 45 f4             	and    %eax,-0xc(%ebp)	*/
	a = a & ~(1 << vc);

 /*804851f:	8b 45 f4             	mov    -0xc(%ebp),%eax	// eax = vb&a
 8048522:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048526:	c7 04 24 99 87 04 08 	movl   $0x8048799,(%esp)
 804852d:	e8 5e fe ff ff       	call   8048390 <printf@plt>*/
	printf("%lx\n", a); 

 /*8048532:	8b 45 10             	mov    0x10(%ebp),%eax
 8048535:	8b 55 0c             	mov    0xc(%ebp),%edx
 8048538:	89 c1                	mov    %eax,%ecx
 804853a:	d3 e2                	shl    %cl,%edx
 804853c:	89 d0                	mov    %edx,%eax
 804853e:	09 45 f4             	or     %eax,-0xc(%ebp)*/
	a = a | (vb << vc);

 /*8048541:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8048544:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048548:	c7 04 24 a6 87 04 08 	movl   $0x80487a6,(%esp)
 804854f:	e8 3c fe ff ff       	call   8048390 <printf@plt>*/
	printf("%lx\n", a);

 /*8048554:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp) */
	a = 0x0;

 /*804855b:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
 804855f:	0f 95 c0             	setne  %al
 8048562:	0f b6 c0             	movzbl %al,%eax
 8048565:	89 45 0c             	mov    %eax,0xc(%ebp)
 8048568:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
 804856c:	74 07                	je     8048575 <hieth_set_regbit+0xa5>
 804856e:	b8 84 87 04 08       	mov    $0x8048784,%eax
 8048573:	eb 05                	jmp    804857a <hieth_set_regbit+0xaa>
 8048575:	b8 89 87 04 08       	mov    $0x8048789,%eax
 804857a:	89 44 24 04          	mov    %eax,0x4(%esp)
 804857e:	c7 04 24 8f 87 04 08 	movl   $0x804878f,(%esp)
 8048585:	e8 06 fe ff ff       	call   8048390 <printf@plt> */
	if (vb != 0) {
		printf("%d\n", "True");
	}
	else
		printf("%d\n", "Flase");

 /*804858a:	8b 45 10             	mov    0x10(%ebp),%eax
 804858d:	ba 01 00 00 00       	mov    $0x1,%edx
 8048592:	89 c1                	mov    %eax,%ecx
 8048594:	d3 e2                	shl    %cl,%edx
 8048596:	89 d0                	mov    %edx,%eax
 8048598:	f7 d0                	not    %eax
 804859a:	21 45 f4             	and    %eax,-0xc(%ebp)*/
	a = a & ~(1 << vc);

 /*804859d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 80485a0:	89 44 24 04          	mov    %eax,0x4(%esp)
 80485a4:	c7 04 24 99 87 04 08 	movl   $0x8048799,(%esp)
 80485ab:	e8 e0 fd ff ff       	call   8048390 <printf@plt>*/
	printf("%lx\n", a);

 /*80485b0:	8b 45 10             	mov    0x10(%ebp),%eax
 80485b3:	8b 55 0c             	mov    0xc(%ebp),%edx
 80485b6:	89 c1                	mov    %eax,%ecx
 80485b8:	d3 e2                	shl    %cl,%edx
 80485ba:	89 d0                	mov    %edx,%eax
 80485bc:	09 45 f4             	or     %eax,-0xc(%ebp)*/
	a = a | (vb << vc);

 /*80485bf:	8b 45 f4             	mov    -0xc(%ebp),%eax
 80485c2:	89 44 24 04          	mov    %eax,0x4(%esp)
 80485c6:	c7 04 24 a6 87 04 08 	movl   $0x80487a6,(%esp)
 80485cd:	e8 be fd ff ff       	call   8048390 <printf@plt>*/
	printf("%lx\n", a);

 /*80485d2:	c9                   	leave  
 80485d3:	c3                   	ret   */ 
}

void perfect()
{
 /*80485d4:	55                   	push   %ebp
 80485d5:	89 e5                	mov    %esp,%ebp
 80485d7:	83 ec 18             	sub    $0x18,%esp
 80485da:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
 80485e1:	00 
 80485e2:	c7 44 24 04 05 00 00 	movl   $0x5,0x4(%esp)
 80485e9:	00 
 80485ea:	c7 04 24 b4 87 04 08 	movl   $0x80487b4,(%esp)
 80485f1:	e8 9a fd ff ff       	call   8048390 <printf@plt>
 80485f6:	c9                   	leave  
 80485f7:	c3                   	ret  */  
	printf("%d %d\n", 0x5, 0x4);
}

void perfect2()
{
 /*80485f8:	55                   	push   %ebp
 80485f9:	89 e5                	mov    %esp,%ebp
 80485fb:	83 ec 18             	sub    $0x18,%esp
 80485fe:	c7 44 24 04 05 00 00 	movl   $0x5,0x4(%esp)
 8048605:	00 
 8048606:	c7 04 24 d4 87 04 08 	movl   $0x80487d4,(%esp)
 804860d:	e8 7e fd ff ff       	call   8048390 <printf@plt>
 8048612:	c9                   	leave  
 8048613:	c3                   	ret */ 
	printf("%d\n", 0x5);  
}

int main()
{
 /*8048614:	55                   	push   %ebp
 8048615:	89 e5                	mov    %esp,%ebp
 8048617:	83 e4 f0             	and    $0xfffffff0,%esp
 804861a:	83 ec 20             	sub    $0x20,%esp
 804861d:	c7 44 24 1c 01 00 00 	movl   $0x1,0x1c(%esp)
 8048624:	00 */
	unsigned long a = 0x1;

 //8048625:	83 7c 24 1c 00       	cmpl   $0x0,0x1c(%esp)
	a = !a;
 /*804862a:	0f 94 c0             	sete   %al
 804862d:	0f b6 c0             	movzbl %al,%eax
 8048630:	89 44 24 1c          	mov    %eax,0x1c(%esp)
 8048634:	8b 44 24 1c          	mov    0x1c(%esp),%eax
 8048638:	89 44 24 04          	mov    %eax,0x4(%esp)
 804863c:	c7 04 24 e3 87 04 08 	movl   $0x80487e3,(%esp)
 8048643:	e8 48 fd ff ff       	call   8048390 <printf@plt>*/
	printf("%ld\n", a);

 /*8048648:	e8 87 ff ff ff       	call   80485d4 <perfect>*/
	perfect();

 /*804864d:	e8 a6 ff ff ff       	call   80485f8 <perfect2>*/
	perfect2();

 /*8048652:	c7 44 24 18 06 00 10 	movl   $0x100006,0x18(%esp)
 8048659:	00 */
	unsigned long b = 0x100006;
 /*804865a:	8b 44 24 18          	mov    0x18(%esp),%eax
 804865e:	c1 e8 10             	shr    $0x10,%eax
 8048661:	89 44 24 14          	mov    %eax,0x14(%esp)*/
	unsigned long c = (b >> 0x10);

 /*8048665:	8b 44 24 18          	mov    0x18(%esp),%eax
 8048669:	83 e0 1f             	and    $0x1f,%eax // eax=b&0x1f
	
 804866c:	ba 01 00 00 00       	mov    $0x1,%edx	// edx=0x1
 8048671:	89 c1                	mov    %eax,%ecx	// ecx=b&0x1f
 8048673:	d3 e2                	shl    %cl,%edx		// edx=0x1<<((b&0x1f)&0xff)
 8048675:	89 d0                	mov    %edx,%eax	// eax=0x1<<((b&0x1f)&0xff)
 8048677:	8d 50 ff             	lea    -0x1(%eax),%edx	// edx=(0x1<<((b&0x1f)&0xff))-1
 804867a:	8b 44 24 14          	mov    0x14(%esp),%eax	// eax = c
 804867e:	89 c1                	mov    %eax,%ecx		// ecx = c
 8048680:	d3 e2                	shl    %cl,%edx			// edx = ((0x1<<((b&0x1f)&0xff))-1) << (c&0xff)
 8048682:	89 d0                	mov    %edx,%eax		// eax = edx
 8048684:	89 44 24 10          	mov    %eax,0x10(%esp)	*/
	unsigned long d = ((0x1<<((b&0x1f)))-1) << (c);

 /*8048688:	8b 44 24 10          	mov    0x10(%esp),%eax
 804868c:	89 44 24 0c          	mov    %eax,0xc(%esp)
 8048690:	8b 44 24 14          	mov    0x14(%esp),%eax	// c
 8048694:	89 44 24 08          	mov    %eax,0x8(%esp)
 8048698:	8b 44 24 18          	mov    0x18(%esp),%eax	// b
 804869c:	89 44 24 04          	mov    %eax,0x4(%esp)
 80486a0:	c7 04 24 ee 87 04 08 	movl   $0x80487ee,(%esp)
 80486a7:	e8 e4 fc ff ff       	call   8048390 <printf@plt>*/
	printf("%ld %ld %ld\n", b, c, d);

 /*80486ac:	8b 44 24 10          	mov    0x10(%esp),%eax	// eax = d
 80486b0:	83 e0 01             	and    $0x1,%eax		// eax = d&0x1
 80486b3:	89 c2                	mov    %eax,%edx		// edx = d&0x1
 80486b5:	8b 44 24 14          	mov    0x14(%esp),%eax	// eax = c
 80486b9:	89 c1                	mov    %eax,%ecx		// ecx = c
 80486bb:	d3 ea                	shr    %cl,%edx			// edx = (d&0x1)>>c
 80486bd:	89 d0                	mov    %edx,%eax		// eax = (d&0x1)>>c
 80486bf:	89 44 24 04          	mov    %eax,0x4(%esp)	
 80486c3:	c7 04 24 fa 87 04 08 	movl   $0x80487fa,(%esp)
 80486ca:	e8 c1 fc ff ff       	call   8048390 <printf@plt> */
	//printf("%d\n",  (d&0x1)>>c);

 /*80486cf:	89 44 24 04          	mov    %eax,0x4(%esp)
 80486d3:	c7 04 24 fe 87 04 08 	movl   $0x80487fe,(%esp)
 80486da:	e8 b1 fc ff ff       	call   8048390 <printf@plt>*/
	printf("%d\n",  printf("%ld\n",  (d&0x1)>>c));

 /*80486df:	b8 00 00 00 00       	mov    $0x0,%eax
 80486e4:	c9                   	leave  
 80486e5:	c3                   	ret    */
	return 0;
}

